<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>个人请假查看</title>
    <script src="../static/js/jquery-3.2.1.min.js"></script>
    <script src="../static/js/vue.js"></script>
    <link href="//unpkg.com/layui@2.8.0/dist/css/layui.css" rel="stylesheet">
    <!-- 引入 layui.js -->
    <script src="//unpkg.com/layui@2.8.0/dist/layui.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script src="../static/js/Core_values.js"></script>

    <style>
        #app {
            width: 1000px;
            position:absolute;
            left:0;
            right:0;
            margin:0 auto;
            margin-top: 200px;
        }
    </style>
</head>
<body>
<script src="../static/js/flower.js"></script>

<div id="app">
    <template>
        <el-table
                :data="tableData"
                style="width: 100%">
            <el-table-column
                    prop="userRealName"
                    label="姓名"
                    width="200">
            </el-table-column>
            <el-table-column
                    prop="tripDate"
                    label="申请日期"
                    width="300">
            </el-table-column>
            <el-table-column
                    prop="tripDays"
                    label="申请天数"
                    width="100">
            </el-table-column>
            <el-table-column
                    prop="tripStatus"
                    label="当前申请状态"
                    width="200">
            </el-table-column>
            <el-table-column
                    prop="tripApproval"
                    label="当前审批状态"
                    width="200">
            </el-table-column>
        </el-table>
    </template>
</div>
<script>
    new Vue({
        el: "#app",
        data: {
            tableData: [],
            userName:JSON.parse(localStorage.getItem("userName"))
        },
        methods: {
            selectPersonal() {
                var v = this
                $.ajax({
                    url: "../trip/personal/" + v.userName,
                    type: "get",
                    data: v.userName,
                    success: function (res) {
                        v.tableData = res.object
                        console.log(res.object)
                    }
                })
            }
        },
        mounted: function () {
            this.selectPersonal()
        }
    })
</script>


</body>
</html>
